import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/ManageHomeVisiting/GetVisitingRecordList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

// 学生下拉
export const StudentList = (params) => {
  return request({
    url: '/api/ManageHomeVisiting/GetTeacherStudentSelect',
    method: 'get',
    params: {
      ...params,
    }
  })
}

// 课程
export const CourseList = (params) => {
  return request({
    url: '/api/ManageHomeVisiting/GetCourseTeacherSelect',
    method: 'get',
    params: {
      ...params,
    }
  })
}
export const getDetail = (id) => {
  return request({
    url: '/api/ManageHomeVisiting/GetVisitingRecordInfo',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (row) => {
  return request({
    url: '/api/ManageHomeVisiting/DelVisiting',
    method: 'post',
    data: row,
  })
}

export const add = (row) => {
  return request({
    url: '/api/ManageHomeVisiting/AddTeacherVisiting',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/ManageHomeVisiting/AddTeacherVisiting',
    method: 'post',
    data: row
  })
}

// 结束家访
export const finishVisiting = (row) => {
  return request({
    url: '/api/ManageHomeVisiting/FinishVisiting',
    method: 'post',
    data: row
  })
}

// 家访反馈记录
export const getFeedbackRecordInfo = (id) => {
  return request({
    url: '/api/ManageHomeVisiting/GetFeedbackRecordInfo',
    method: 'get',
    params: {
      id
    }
  })
}

// 编辑/新增家访
export const editFeedbackRecord = (row) => {
  return request({
    url: '/api/ManageHomeVisiting/EditFeedbackRecord',
    method: 'post',
    data: row
  })
}


// 获取学校、教师信息
export const getTeacherByRelateId = () => {
  return request({
    url: '/api/PcPublicService/GetTeacherByRelateId',
    method: 'get',
    params: {}
  })
}

// 推送消息
export const pushVisitingMessage = (params) => {
  return request({
    url: '/api/ManageHomeVisiting/PushVisitingMessage',
    method: 'get',
    params: params
  })
}
